/** Model representation of Property entity
 *
 *  @author Scott Monahan
 *  @version $Id$
 *  
 *  File last changed on $Date:$ by $Author:$ in $Rev:$
 *
 */

package info637.pprc.model;

import info637.pprc.repository.AbstractEntity;

public class Property extends AbstractEntity {

	// Key
	private String address = null;
	private String city = null;
	private String state = null;
	private String zip = null;
	
	// Required but not part of the key
	private String propertyName = null;
	private String monthlyRent = null;
	private String contactInfo = null;
	
	// Not Required or could have default value
	private String tenantName = "";
	private String balance = "0";
	
	private String securityDeposit = "0";
	private String ownerName = null;
	private String numOfBeds = null;
	private String numOfBaths = null;
	private String sqft = null;
	private String appliances = null;
	private String description = null;
	private String showOnline = null;
	private String showInFlyer = null;

	public Property(String address, String city, String state, String zip) {
		
		this.address = address;
		this.city = city;
		this.state = state;
		this.zip = zip;
	}
	
	public Property(String address, String city, String state, String zip, String monthlyRent) {
		
		this.address = address;
		this.city = city;
		this.state = state;
		this.zip = zip;
		this.monthlyRent = monthlyRent;
	}
	
	public Property(String propertyName, String tenantName, String balance) {
		
		this.propertyName = propertyName;
		this.tenantName = tenantName;
		this.balance = balance;
	}
	
	public Property(String propertyName, String address, String city, String state,
		String zip, String monthlyRent, String securityDeposit,
		String ownerName, String numOfBeds, String numOfBaths, String sqft,
		String appliances, String description, String contactInfo,
		String showOnline, String showInFlyer) {
		
		this.address = address;
		this.city = city;
		this.state = state;
		this.zip = zip;
		this.monthlyRent = monthlyRent;
		this.propertyName = propertyName;
		this.securityDeposit = securityDeposit;
		this.ownerName = ownerName;
		this.numOfBeds = numOfBeds;
		this.numOfBaths = numOfBaths;
		this.sqft = sqft;
		this.appliances = appliances;
		this.description = description;
		this.contactInfo = contactInfo;
		this.showOnline = showOnline;
		this.showInFlyer = showInFlyer;
	}
	
	public Property(String id, String propertyName, String monthlyRent, String securityDeposit,
		String ownerName, String numOfBeds, String numOfBaths, String sqft,
		String appliances, String description, String contactInfo,
		String showOnline, String showInFlyer) {
		
		this.setId(id);
		this.monthlyRent = monthlyRent;
		this.propertyName = propertyName;
		this.securityDeposit = securityDeposit;
		this.ownerName = ownerName;
		this.numOfBeds = numOfBeds;
		this.numOfBaths = numOfBaths;
		this.sqft = sqft;
		this.appliances = appliances;
		this.description = description;
		this.contactInfo = contactInfo;
		this.showOnline = showOnline;
		this.showInFlyer = showInFlyer;
	}

	public String getAddress() {
		
		return address;
	}

	public String getCity() {
		
		return city;
	}

	public String getState() {
		
		return state;
	}

	public String getZip() {
		
		return zip;
	}

	public String getPropertyName() {
		
		return propertyName;
	}

	public void setPropertyName(String propertyName) {
		
		this.propertyName = propertyName;
	}
	
	public String getMonthlyRent() {
		
		return monthlyRent;
	}

	public void setMonthlyRent(String monthlyRent) {
		
		this.monthlyRent = monthlyRent;
	}

	public String getTenantName() {
		
		return tenantName;
	}

	public void setTenantName(String tenantName) {
		
		this.tenantName = tenantName;
	}

	public String getBalance() {
		
		return balance;
	}

	public void setBalance(String balance) {
		
		this.balance = balance;
	}
	
	public String getContactInfo() {
		
		return contactInfo;
	}

	public void setContactInfo(String contactInfo) {
		
		this.contactInfo = contactInfo;
	}

	public String getSecurityDeposit() {
		
		return securityDeposit;
	}

	public void setSecurityDeposit(String securityDeposit) {
		
		this.securityDeposit = securityDeposit;
	}

	public String getOwnerName() {
		
		return ownerName;
	}

	public void setOwnerName(String ownerName) {
		
		this.ownerName = ownerName;
	}

	public String getNumOfBeds() {
		
		return numOfBeds;
	}

	public void setNumOfBeds(String numOfBeds) {
		
		this.numOfBeds = numOfBeds;
	}

	public String getNumOfBaths() {
		
		return numOfBaths;
	}

	public void setNumOfBaths(String numOfBaths) {
		
		this.numOfBaths = numOfBaths;
	}

	public String getSqft() {
		
		return sqft;
	}

	public void setSqft(String sqft) {
		
		this.sqft = sqft;
	}

	public String getAppliances() {
		
		return appliances;
	}

	public void setAppliances(String appliances) {
		
		this.appliances = appliances;
	}

	public String getDescription() {
		
		return description;
	}

	public void setDescription(String description) {
		
		this.description = description;
	}

	public String getShowOnline() {
		
		return showOnline;
	}

	public void setShowOnline(String showOnline) {
		
		this.showOnline = showOnline;
	}

	public String getShowInFlyer() {
		
		return showInFlyer;
	}

	public void setShowInFlyer(String showInFlyer) {
		
		this.showInFlyer = showInFlyer;
	}
	
	public void update(Property toCopy) {
		
		this.propertyName = updateValue(this.propertyName, toCopy.getPropertyName());
		this.monthlyRent = updateValue(this.monthlyRent, toCopy.getMonthlyRent());
		this.contactInfo = updateValue(this.contactInfo, toCopy.getContactInfo());
		
		if (!toCopy.getSecurityDeposit().equalsIgnoreCase("0")) {
			
			this.securityDeposit = updateValue(this.securityDeposit, toCopy.getSecurityDeposit());
		}
		
		this.ownerName = updateValue(this.ownerName, toCopy.getOwnerName());
		this.numOfBeds = updateValue(this.numOfBeds, toCopy.getNumOfBeds());
		this.numOfBaths = updateValue(this.numOfBaths, toCopy.getNumOfBaths());
		this.sqft = updateValue(this.sqft, toCopy.getSqft());
		this.appliances = updateValue(this.appliances, toCopy.getAppliances());
		this.description = updateValue(this.description, toCopy.getDescription());
		this.showOnline = updateValue(this.showOnline, toCopy.getShowOnline());
		this.showInFlyer = updateValue(this.showInFlyer, toCopy.getShowInFlyer());
	}
}
